#ifndef __DMP_HAL_H
#define __DMP_HAL_H

#include <stdint.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>

#include "i2c.h"
#include "stm32h7xx_hal.h"

#define log_e(message,...) printf("[ERROR] ");printf(message,##__VA_ARGS__)
#define log_i(message,...) printf("[INFO] ");printf(message,##__VA_ARGS__)
#define min(a,b) ((a)>(b))?(b):(a)

int i2c_write(uint8_t slave_addr,uint8_t reg_addr,uint8_t length,const uint8_t *data);
int i2c_read(uint8_t slave_addr,uint8_t reg_addr,uint8_t length,uint8_t *data);
void delay_ms(uint32_t num_ms);
void get_ms(uint32_t *count);

#endif